/*
 * Takes a speed in miles per second and returns the speed in km per hour
 */
mpsToKmph = function(mps) {
    mpkm = 1000;
    spmin = 60;
    minph = 60;
    return mps / mpkm * spmin * minph;
};

/*
 * Sets href of buttons in pages and let home-button refer to user_id-home
 */
getButtons = function(user_id) {
$("#homeButton").button().on('click', function() {window.location.href = '/webappz-gu/user.jsp?user=' + user_id;});
$("#logout").button().on('click', function() {window.location.href = 'logout';});
};

/*
 * Set defaults for plots
 */
var plot_options = {
    axes: {
        yaxis: {
            min: 0,
            max: 10,
            numberTicks: 6,
        },
        xaxis: {
            min: 0,
            max: 10,
            numberTicks: 6,
       }
    },
    axesDefaults: {
        showTicks: true,
        showTickMarks: false,
    },
    series: [
        {color: '#FF0000'}
    ],
    seriesDefaults: {
        shadow: false,
        markerOptions: {
            show: false,
            style: "filledCircle",
            lineWidth: 1,
            size: 10,
            color: "#FF0000",
            shadow: false,
        }
    },
    grid: {
        background: "#FFFFFF",
        borderColor: "#000000",
        borderWidth: 0.5,
        shadow: false,
        gridLineColor: "#0000FF",
    },
    cursor: {
        show: true,
        style:"crosshair",
    },
    highlighter: {
        show: true,
        showTooltip: true,
        tooltipAxes: 'both',
        sizeAdjust: 7.5
    }
};

